<?php
	class humanControl extends commonControl{
		function index(){
			$db = M("job");
			$work = $db -> findall();
			$this->assign("work",$work);
			$this->display();
		}

	//添加栏目页面；
		function add_show(){
			$time = date("Y-m-d h:i:s");
			$this -> assign("time",$time);
			$this->display();
		}
	//添加到表中；
		function add(){
			$db = M("job");
			if($db->add()){
				$this->success("添加职位成功","index");
			}else{
				$this->error("添加职位失败","add_show");
			}
		}

		function edit_show(){
			$db = M("job");
			$id = $_GET["id"];
			$work = $db -> findall($id);
			$this->assign("work",$work);
			$this->display();
		}

		function edit(){
			$db= M("job");
			$rows = $_POST;
			if($db->update($rows)){
				$this->success("更新成功","index");
			}else{
				$this->error("更新失败","edit_show");
			}
		}

		function del(){
			$db = M("job");
			$id = $_GET["id"];
			if($db->del($id)){
				$this->success("删除成功","index");
			}else{
				$this->error("删除失败");
			}
		}

	}
?>